//
//  ViewController.m
//  SoundPlayer
//
//  Created by iD Student on 6/25/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"Thunder_2" withExtension:@"mp3"];
                  NSError *error;
    explosionSound = [[AVAudioPlayer alloc] initWithContentsOfURL: url error: &error];
                  if(error != nil)
                  {
                      NSLog(@"Explosion sound could not be loaded.");
                      
                  }
    url = [[NSBundle mainBundle] URLForResource:@"Jet_Plane" withExtension:@"mp3"];
    error = nil;
    laserSound = [[AVAudioPlayer alloc] initWithContentsOfURL: url error: &error];
    if(error != nil)
    {
        NSLog(@"Explosion sound could not be loaded.");
        
    }
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction) explosionButtonPressed: (id) sender {[explosionSound play]; }
- (IBAction) laserButtonPressed: (id) sender {[laserSound play]; }

@end
